package net.googlecode.garzha.services;

import net.googlecode.garzha.dao.PersonDAO;
import net.googlecode.garzha.domains.Comment;
import net.googlecode.garzha.domains.Group;
import net.googlecode.garzha.domains.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 01.06.11
 * Time: 17:32
 * To change this template use File | Settings | File Templates.
 */
@Service
public class PersonServiceImpl implements PersonService {

    @Autowired
    private PersonDAO personDAO;

    @Transactional
    public Person getPerson(String email) {
        return personDAO.getPerson(email);


    }
    @Transactional
     public Person getPersonID(String id){
        return personDAO.getPersonID(id);
    }
    @Transactional
 public List getListComment(String id) {
        return personDAO.getListComment(id);
    }

    @Transactional

    public void addComment(Comment com){
             personDAO.addComment(com);
    }
    @Transactional
    public List getListGroup() {
        return personDAO.getListGroup();
    }
    @Transactional
     public void updatePerson(Person prs){

        personDAO.updatePerson(prs);

     }
    @Transactional
    public void addPerson(Person prs) {
        personDAO.addPerson(prs);
    }

    @Transactional
    public Group getGroup(Integer id) {

        return personDAO.getGroup(id);


    }

    @Transactional
    public List getGroupMates(Person prs) {
        return personDAO.getGroupMates(prs);

    }

    @Transactional
    public List getTop5() {
        return personDAO.getTop5();
    }
}
